import mockJson from './mock.json'
export const request = (time = 0) => {
	return new Promise((resolve, reject) => {
		setTimeout(() => resolve(mockJson), time)
	})
}

export const getMockInfo = async () => {
	const result = await request() as {success: boolean, result: {}}
	if (result.success) {
		window.$message.success('Successfully request')
	} else {
		window.$message.error('Failed request')
	}
}

export const getRouteMockInfo = async () => {
	const result = await request(1000) as {success: boolean, result: {}}
	return result
}
